package io.github.wslxm.springbootplus2.starter.redis.config.next;

/**
 * 动态租户
 * @author 王松
 * @mail 1720696548@qq.com
 * @date 2024/9/29 14:58
 */
public class CacheThreadLocal {

    private static final ThreadLocal<String> cachePrefix = new ThreadLocal<>();

    public static void setPrefix(String tenant) {
        cachePrefix.set(tenant);
    }

    public static String getPrefix() {
        return cachePrefix.get();
    }

    public static void remove() {
        cachePrefix.remove();
    }
}
